﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class TestGoldEvent : MonoBehaviour {

    [MenuItem("Plateface/AddEvent")]
    // Use this for initialization
    public static void AddGoldEvent()
    {
        //var eventList = PlayMakerGlobals.Instance.Events;
        //List<string> del = new List<string>();

        //for (int i = eventList.Count - 1; i > 0; i--)
        //{
        //    if (eventList[i].StartsWith("UI1/"))
        //    {
        //        del.Add(eventList[i]);
        //        PlayMakerGlobals.RemoveGlobalEvent(eventList[i]);
        //        eventList.RemoveAt(i);
        //    }
        //}

        ////foreach (var item in eventList)
        ////{
        ////    if (item.StartsWith("UI1/"))
        ////    {
        ////        del.Add(item);
        ////    }
        ////}

        //foreach (var item in del)
        //{
        //    PlayMakerGlobals.RemoveGlobalEvent(item);
        //}

        //PlayMakerGlobals.Instance.AddEvent("UI1/A");
        //PlayMakerGlobals.Instance.AddEvent("UI1/B");
        //PlayMakerGlobals.Instance.AddEvent("UI1/C");
        //PlayMakerGlobals.Instance.AddEvent("UI2/D");
        //PlayMakerGlobals.Instance.AddEvent("UI2/E");
        //PlayMakerGlobals.Instance.AddEvent("UI2/F");
        
        PlayMakerGlobals.AddGlobalEvent("UI1/A");
        PlayMakerGlobals.AddGlobalEvent("UI1/B");
        PlayMakerGlobals.AddGlobalEvent("UI1/C");
        PlayMakerGlobals.AddGlobalEvent("UI2/D");
        PlayMakerGlobals.AddGlobalEvent("UI2/E");
        PlayMakerGlobals.AddGlobalEvent("UI2/F");
    }

    [MenuItem("Plateface/DeleteEvent")]
    // Use this for initialization
    public static void DeleteEvent()
    {
        PlayMakerGlobals.IsBuilding = true;
        PlayMakerGlobals.RemoveGlobalEvent("UI1/A");
        PlayMakerGlobals.RemoveGlobalEvent("UI1/B");
        PlayMakerGlobals.RemoveGlobalEvent("UI1/C");
        PlayMakerGlobals.RemoveGlobalEvent("UI2/D");
        PlayMakerGlobals.RemoveGlobalEvent("UI2/E");
        PlayMakerGlobals.RemoveGlobalEvent("UI2/F");
        PlayMakerGlobals.InitApplicationFlags();
        PlayMakerGlobals.IsBuilding = false;
    }

    // Update is called once per frame
    void Update () {
		
	}
}


